﻿Public Class FormMesProjectList
    Dim objProdInfo As New clsProdInfo
    Public mes_project_code As String = String.Empty
    Public mes_project_name As String = String.Empty
    Private Sub FormMesProjectList_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        txt_mes_project_code.Text = mes_project_code
        txt_mes_project_name.Text = mes_project_name
        setDgvData()
    End Sub

    Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
        setDgvData()
    End Sub

    Private Sub setDgvData()
        If String.IsNullOrEmpty(txt_mes_project_code.Text.Trim()) = False And String.IsNullOrEmpty(txt_mes_project_name.Text.Trim()) = False Then
            Dim dt As DataTable = objProdInfo.getProdInfoListByProject(txt_mes_project_code.Text.Trim(), txt_mes_project_name.Text.Trim())
            dgv.AutoGenerateColumns = False
            dgv.DataSource = dt
        Else
            MsgBox("请输入项目编号和项目名称进行查询")
        End If
    End Sub

End Class